this._indicator = this._addIndicator();
this._indicator.icon_name = 'bluetooth-active-symbolic';
this._hadSetupDevices = global.settings.get_boolean(HAD_BLUETOOTH_DEVICES_SETUP);
+ this._client = new GnomeBluetooth.Client();
this._proxy = new RfkillManagerProxy(Gio.DBus.session, BUS_NAME, OBJECT_PATH,
(proxy, error) => {
this._toggleItem = new PopupMenu.PopupMenuItem('');
this._toggleItem.connect('activate', () => {
this._proxy.BluetoothAirplaneMode = !this._proxy.BluetoothAirplaneMode;
+ if (!this._proxy.BluetoothAirplaneMode)
+ this._client.default_adapter_powered = true;
});
this._item.menu.addMenuItem(this._toggleItem);
this._syncId = 0;
this._adapter = null;
- this._client = new GnomeBluetooth.Client();
this._store = this._client.get_devices();
this._deviceNotifyConnected = [];
this._client.connect('device-removed', (c, path) => {
else
this._item.label.text = _('Bluetooth On');
- this._toggleItem.label.text = this._proxy.BluetoothAirplaneMode ? _('Turn On') : _('Turn Off');
+ this._toggleItem.label.text = this._client.default_adapter_powered ? _('Turn Off') : _('Turn On');
}
});